package com.cj.mobile.iabp.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 新建联单中选择批次和批次结果
 */
public class TransferBatchInfo implements Parcelable {

    public TransferBatchInfo() {
    }

    public TransferBatchInfo(String batchNo, String inDepotTime, String categoryName, String depotName, String totalWeight, String totalNum, String totalCost, String unit) {
        this.batchNo = batchNo;
        this.inDepotTime = inDepotTime;
        this.categoryName = categoryName;
        this.depotName = depotName;
        this.totalWeight = totalWeight;
        this.totalNum = totalNum;
        this.totalCost = totalCost;
        this.unit = unit;
    }

    /**
     * batchNo :
     * inDepotTime :
     * categoryName :
     * depotName :
     * totalWeight :
     * totalNum :
     * totalCost :
     * unit :
     */

    // 批次号
    private String batchNo;
    // 入库日期
    private String inDepotTime;
    // 品类
    private String categoryName;
    // 仓库名称
    private String depotName;
    // 总重量
    private String totalWeight;
    // 总数量
    private String totalNum;
    // 总成本
    private String totalCost;
    // 单位
    private String unit;

    // 是否选中(本地数据)
    private boolean isChecked = false;

    public boolean isChecked() {
        return isChecked;
    }

    public void setChecked(boolean checked) {
        isChecked = checked;
    }

    public String getBatchNo() {
        return batchNo;
    }

    public void setBatchNo(String batchNo) {
        this.batchNo = batchNo;
    }

    public String getInDepotTime() {
        return inDepotTime;
    }

    public void setInDepotTime(String inDepotTime) {
        this.inDepotTime = inDepotTime;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getDepotName() {
        return depotName;
    }

    public void setDepotName(String depotName) {
        this.depotName = depotName;
    }

    public String getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(String totalWeight) {
        this.totalWeight = totalWeight;
    }

    public String getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(String totalNum) {
        this.totalNum = totalNum;
    }

    public String getTotalCost() {
        return totalCost;
    }

    public void setTotalCost(String totalCost) {
        this.totalCost = totalCost;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.batchNo);
        dest.writeString(this.inDepotTime);
        dest.writeString(this.categoryName);
        dest.writeString(this.depotName);
        dest.writeString(this.totalWeight);
        dest.writeString(this.totalNum);
        dest.writeString(this.totalCost);
        dest.writeString(this.unit);
        dest.writeByte(this.isChecked ? (byte) 1 : (byte) 0);
    }

    protected TransferBatchInfo(Parcel in) {
        this.batchNo = in.readString();
        this.inDepotTime = in.readString();
        this.categoryName = in.readString();
        this.depotName = in.readString();
        this.totalWeight = in.readString();
        this.totalNum = in.readString();
        this.totalCost = in.readString();
        this.unit = in.readString();
        this.isChecked = in.readByte() != 0;
    }

    public static final Parcelable.Creator<TransferBatchInfo> CREATOR = new Parcelable.Creator<TransferBatchInfo>() {
        @Override
        public TransferBatchInfo createFromParcel(Parcel source) {
            return new TransferBatchInfo(source);
        }

        @Override
        public TransferBatchInfo[] newArray(int size) {
            return new TransferBatchInfo[size];
        }
    };
}
